package com.pluszg.nutrition.api.controller.account;

import com.pluszg.nutrition.model.account.Account;
import com.pluszg.nutrition.common.resp.CommonResponse;

import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

@RequestMapping("/user")
public interface AccountController {

    @PostMapping("/add")
    CommonResponse<Account> add(@RequestBody Account account);

    @GetMapping("/{id}")
    CommonResponse<Account> findById(@PathVariable("id")  String id);

    @PostMapping("/modify")
    CommonResponse<Account> modify(@RequestBody Account account);

    @PostMapping("/delete")
    CommonResponse<Boolean> delete(@RequestParam("id")  String id);

    @PostMapping("/reduce")
    CommonResponse<Void> reduceAccount (@RequestParam("id") String id,@RequestParam("amount") BigDecimal amount);
}
